<?php
$idpagina = 1;
include ("cap.php");
?>

<body>
	<div id="templatemo_outer_wrapper">
		<div id="templatemo_wrapper">
			<?php
			include ("menu.php");
			?>
			<div id="templatemo_main">
				<div id="content_title_box">
					<div id="content_top"></div>
            		<div id="content_center">
            		
				<div id="taula">
					<?php

if(isset($_SESSION["username"])){
echo        "<h1>Historial de incidencias</h1>";
					?>
					<?php

					$client = $_SESSION["idClient"];

					$result = mysql_query("select *,nom_producte from incidencies join productes on incidencies.id_producte=productes.id_productes where id_clients='$client'"); ;

					echo "<table border = '3' > \n";
					echo "<tr> \n";
					echo "<td><b>Numero Incidencia</b></td> \n";
					echo "<td><b>Producto</b></td> \n";
					echo "<td><b>Fecha de la Incidencia</b></td> \n";
					echo "<td><b>Motivo de la incidencia</b></td> \n";
					echo "<td><b>Persona de Contacto</b></td> \n";
					echo "<td><b>Estado de la Incidencia</b></td> \n";

					echo "</tr> \n";
					while ($row = mysql_fetch_array($result)) {

						echo "<tr> \n";
						echo "<td>" . $row['id_incidencias'] . "</td> \n";
						echo "<td>" . $row['nom_producte'] . "</td>\n";
						echo "<td>" . $row['data'] . "</td>\n";
						echo "<td>" . $row['descripcio'] . "</td>\n";
						echo "<td>" . $row['persona_contacte'] . "</td>\n";
						echo "<td>" . $row['estado'] . "</td>\n";

						/*echo "<td>".$row[""]."</td> \n";      */
						echo "</tr> \n";
					}
					echo "</table> \n";
 echo "<h3><a href='incidencias.php'>Volver</h3>";
					}
					?>
				</div>
               	</div>
               		<div id="content_bottom"></div>
					
				</div>
				<!-- end of featured project -->
			</div>
			<!-- end of main -->
				
				
			
				<!-- end of featured project -->
			</div>
			<!-- end of main -->
		</div>
		
